Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create migration files for upgrade from 1.0 to 1.5 #2962

Merged
merged 23 commits into from
Sep 29, 2017

Conversation

impactmass
Copy link
Contributor

@impactmass impactmass commented Sep 27, 2017

Resolves in part #2938

How To Test:

  • On an updated marketplace branch, git checkout to commit 91e18f26b7bc. That's v1.0.0 commit. (You can also checkout into the tag if you have fetched it earlier).
  • After reaction reset -y && reaction, create a few orders, and also add a product to cart without checking out.
  • After that, checkout back to marketplace. Then run reaction pull marketplace (I do this just to use cli to re-instal modules). Then, fetch+checkout into branch seun-migration-1.0-1.5.
  • Start reaction again. Confirm that migrations run up to version 15.
  • Visit the Order dashboard, visit the PDP, and other pages. The goal is to have everything run smoothly as it should. This PR at the moment doesn't fully solve that. It gets us to the point of loading the app successfully, and being able to see Order dashboard (with shipping working).

Next up to resolve will be Refunds (which is the error you'll be seeing in your console). This PR as is can still be merged will I start working separately to fix the other issues.

Other issues found (if related to migration) can be reported on the main ticket #2938.

@impactmass impactmass changed the title [WIP] Create migration files for upgrade from 1.0 to 1.5 Create migration files for upgrade from 1.0 to 1.5 Sep 29, 2017
// workflow object that keeps track of previous state.
up: function () {
Orders.find().forEach((order) => {
const currentShipping = order.shipping[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be the hard-coded first shipping object or the shipping object associated with the current active shop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that to staying consistent with 1.0 (or below 1.5) codebase. It's all x[0] in there. Since this migration file is interacting with data created from such code, I referenced it that way.
I think it's more recently that we started referencing shipping it by shopId (i.e marketplace).

@spencern
Copy link
Contributor

spencern commented Sep 29, 2017

One issue I'm seeing that could be resolved in the next ticket is that routes are different between 1.0 and 1.5.

I'm not really sure the best way to resolve this, as it will probably need some type of redirect, and it will be different depending on the shop, especially if any shops in the 1.0 -> 1.4.3 have I think what we need is some way to define redirects within the app. This really will only be an issue for SEO, as pathfor, etc have been updated internally, but that's a pretty huge issue for any live shop.

image

Copy link
Contributor

@spencern spencern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.
Migrations run well up to version 15.

23:14:42.205Z  INFO Reaction: Reaction Version: 1.5.0
23:14:42.278Z  INFO Reaction: Migrating from version 3 -> 15
23:14:42.278Z  INFO Reaction: Running up() on version 4
23:14:42.539Z  INFO Reaction: Running up() on version 5
23:14:42.931Z  INFO Reaction: Running up() on version 6
23:14:42.942Z  INFO Reaction: Running up() on version 7
23:14:43.002Z  INFO Reaction: Running up() on version 8
23:14:43.578Z  INFO Reaction: Running up() on version 9
23:14:43.643Z  INFO Reaction: Running up() on version 10
23:14:43.671Z  INFO Reaction: Running up() on version 11
23:14:45.938Z  INFO Reaction: Running up() on version 12
23:14:46.132Z  INFO Reaction: Running up() on version 13
23:14:46.255Z  INFO Reaction: Running up() on version 14
23:14:46.278Z  INFO Reaction: Running up() on version 15
23:14:46.368Z  INFO Reaction: Finished migrating.
23:14:46.687Z  INFO Reaction: Reaction initialization finished.
=> Started your app.

=> App running at: http://localhost:3000/

@spencern
Copy link
Contributor

Also seeing this issue here (same as what @mikemurray reported in #2938), but tested and it's also present in `marketplace right now, so not blocking for me.

23:39:46.379Z ERROR Reaction: Failed to shop/createShop
  Error: Units of length is required
      at getErrorObject (packages/aldeed_collection2-core.js:480:15)
      at [object Object].doValidate (packages/aldeed_collection2-core.js:462:13)
      at [object Object].Mongo.Collection.(anonymous function) (packages/aldeed_collection2-core.js:214:25)
      at [object Object].Mongo.Collection.(anonymous function) [as insert] (packages/dispatch_run-as-user.js:325:19)
      at [object Object].shopCreateShop (server/methods/core/shop.js:88:25)
      at packages/check.js:128:16
      at [object Object].EVp.withValue (packages/meteor.js:1134:15)
      at Object.exports.Match._failIfArgumentsAreNotAllChecked (packages/check.js:127:41)
      at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1765:18)
      at packages/ddp-server/livedata_server.js:1686:15
      at [object Object].EVp.withValue (packages/meteor.js:1134:15)
      at packages/ddp-server/livedata_server.js:1684:36
      at [object Object]._.extend.applyAsync (packages/ddp-server/livedata_server.js:1683:12)
      at [object Object]._.extend.apply (packages/ddp-server/livedata_server.js:1622:26)
      at [object Object]._.extend.call (packages/ddp-server/livedata_server.js:1604:17)
      at [object Object]._inviteShopOwner (server/methods/accounts/accounts.js:557:29)

@spencern spencern merged commit 782ce04 into marketplace Sep 29, 2017
@spencern spencern deleted the seun-migration-1.0-1.5 branch September 29, 2017 23:48
@spencern spencern mentioned this pull request Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants